home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows4 / prndrv.zip / MAIN.C < prev    next >
Text File  |  1992-02-20  |  2KB  |  70 lines

  1. //*************************************************************
  2. //  File name: main.c
  3. //
  4. //  Description:
  5. //
  6. //      Contains the message loop for the main application window.
  7. //
  8. //
  9. // Development Team:
  10. //
  11. //      Don Miller
  12. //
  13. //
  14. // Written by Microsoft Product Support Services, Windows Developer Support
  15. // Copyright (c) 1992 Microsoft Corporation. All rights reserved.
  16. //*************************************************************
  17.  
  18. #include <windows.h>
  19. #include "globals.h"
  20. #include "init.h"
  21. #include "prndrv.h"
  22.  
  23. // Local function prototypes.
  24. int PASCAL WinMain(HANDLE, HANDLE, LPSTR, int);
  25.  
  26. //-----------------------------------------------------------------------
  27. //  Function: WinMain
  28. //
  29. //  Purpose : Called by Windows on app startup.  Initializes everything,
  30. //            and enters a message loop.
  31. //
  32. //  Parms   : hInstance     == Handle to _this_ instance.
  33. //            hPrevInstance == Handle to last instance of app.
  34. //            lpCmdLine     == Command Line passed into app.
  35. //            nCmdShow      == How app should come up (i.e. minimized/normal)
  36. //
  37. //  Returns : Return value from PostQuitMessage.
  38. //-----------------------------------------------------------------------
  39.  
  40. int PASCAL WinMain(HANDLE hInstance,            // This instance
  41.                    HANDLE hPrevInstance,        // Last instance
  42.                    LPSTR  lpCmdLine,            // Command Line
  43.                    int    nCmdShow)             // Minimized or Normal?
  44. {
  45.    MSG msg;
  46.  
  47.  
  48.    if (!hPrevInstance)
  49.       if (!InitApplication (hInstance))
  50.          return (FALSE);
  51.  
  52.    if (!InitInstance(hInstance, nCmdShow))
  53.       return (FALSE);
  54.  
  55.    while (GetMessage(&msg,             // Put Message Here
  56.                      NULL,             // Handle of win receiving msg
  57.                      NULL,             // lowest message to examine
  58.                      NULL))            // highest message to examine
  59.       {
  60.       TranslateMessage(&msg);          // Translates virtual key codes
  61.       DispatchMessage(&msg);           // Dispatches message to window
  62.       }
  63.  
  64.    return (msg.wParam);                // Returns the value from PostQuitMessage
  65. }
  66.  
  67.  
  68.  
  69.  
  70.